home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Communication / HTMLedit173-ppc / HTML.edit 1.7.3 (ppc) / HTML.edit 1.7.3 (ppc).rsrc / TEXT_30603_Editing Netscape Bookmark Files.txt < prev    next >
Text File  |  1996-01-15  |  2KB  |  42 lines

  1.  
  2. Editing Netscape Bookmark Files
  3.  
  4. Netscape bookmark files contain extraneous information which can be easily edited out of the HTML file before importing it into HTML.edit. This takes the form of titles, comments, H3 headings, list item tags, and ADD_DATE and LAST_VISIT attributes on anchors. The trick is learning Grep.
  5.  
  6. Blech. Barf. Yuk. (to quote Dan Connolly) Maybe BBEdit and I can help. While the format of a Netscape bookmark file may change (this description fits version 1.1N), the following explanation will get you started. When performing a replace, turn on Grep where indicated and use the recommended "Search for:" and "Replace" with: strings.
  7.  
  8. 1. Delete the first two lines: <!DOCTYPE> and an HTML comment.
  9.  
  10. 2. Remove all <P>, <HR>, <DL>, </DL> and <DT> tags (Match Case and Grep turned off).
  11.  
  12. 3. Any existing subheadings are instantiated as <H3> elements. Remove the tags from around the text and prefix each on a line with (>I to disable and make it italic (Grep on):
  13.  
  14.    Search for:    <[hH]3 ([^>]*)> 
  15.    Replace with: (>I
  16.  
  17. Remove all instances of </H3>.
  18.  
  19. 4. Remove all ADD_DATE and LAST_VISIT attributes from the remaining anchors:
  20.  
  21.    Search for:     ADD_DATE="[-0-9]*" 
  22.    Search for:     LAST_VISIT="[-0-9]*" 
  23.  
  24. Prefix each Search for: string with a space, and replace in each case with nothing (Grep on).
  25.  
  26. 5. Remove all preceding and trailing spaces on each line (Grep on):
  27.  
  28.    Search for:    \r[ ]*
  29.    Replace with: \r
  30.  
  31.    Search for:    [ ]*\r
  32.    Replace with: \r
  33.  
  34. Then just trim out the empty lines and you're done.
  35.  
  36. While this process took some time to figure out initially, it now takes me about five minutes to translate a Hotlist file, and I thought I'd pass this tidbit along. Since BBEdit is AppleScriptable, I suppose someone could script this. (Anyone volunteer?)
  37.  
  38. Back to Hotlist Maintenance, Libraries Preferences, or return to HTML.edit Features.
  39.  
  40.  
  41.  
  42.